import { h } from 'vue'
import BasicLayout from '@/layouts/BasicLayout.vue'
import Purchase from '@/views/price-sheet/Purchase.vue'
import {
  Add,
  Chinese,
  Buy,
  DashboardOne,
  Forbid,
  Gift,
  HistoryQuery,
  Stretching,
  Diamonds,
  TransactionOrder,
  TreasureChest
} from '@icon-park/vue-next'
import { AuthEnum } from '@/core/enums/auth'

const { ADMIN, AGENT, AGENT_BOSS, SALES, OPERATION, CUSTOMER } = AuthEnum

export default {
  path: '/',
  name: 'index',
  meta: { title: '易百搜（品专）' },
  component: BasicLayout,
  children: [
    {
      path: '/price-package',
      name: 'price-package',
      meta: {
        auth: [ADMIN, SALES, AGENT_BOSS, OPERATION],
        title: '新建查价',
        icon: h(Add, {
          theme: 'filled',
          size: '18',
          fill: '#ff4d4f'
        }),
        parent: {
          path: undefined
        }
      }
      // component: () => import('@/views/price-sheet/PricePackage.vue')
    },
    {
      path: '/price-package-bw',
      name: 'price-package-bw',
      meta: {
        title: '标王查价',
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS],
        // hidden: true,
        activeMenu: '/price-package-bw',
        parent: {
          title: '新建查价',
          path: 'price-package'
        }
      },
      component: () => import('@/views/price-sheet/price-checking-by-category/BW.vue')
    },
    {
      path: '/price-manager',
      name: 'price-manager',
      meta: {
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS],
        title: '查价管理',
        icon: h(HistoryQuery, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/price-sheet/PriceManager.vue')
    },
    {
      path: '/price-detail',
      name: 'price-detail',
      meta: {
        title: '查价详情',
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS],
        hidden: true,
        activeMenu: '/price-manager',
        parent: {
          title: '查价管理',
          path: 'manager'
        }
      },
      component: () => import('@/views/price-sheet/PriceDetail.vue')
    },

    {
      path: '/price-purchase',
      name: 'price-purchase',
      meta: {
        title: '提交成功',
        auth: [ADMIN, AGENT, AGENT_BOSS, SALES, OPERATION],
        hidden: true,
        activeMenu: '/price-package',
        parent: {
          title: '新建查价',
          path: 'price-package'
        }
      },
      component: Purchase
    },
    {
      path: '/order-manager',
      name: 'order-manager',
      meta: {
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS],
        title: '订单管理',
        icon: h(TransactionOrder, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/order/OrderManager.vue')
    },
    {
      path: '/order-detail',
      name: 'order-detail',
      meta: {
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS],
        title: '订单详情',
        hidden: true,
        activeMenu: '/order-manager',
        parent: {
          title: '订单管理',
          path: '/order-manager'
        }
      },
      component: () => import('@/views/order/OrderDetail.vue')
    },
    {
      path: '/promotion',
      name: 'promotion',
      meta: {
        title: '推广管理',
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS, CUSTOMER],
        icon: h(Stretching, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/promotion/Promotion.vue')
    },
    {
      path: '/promotion/detail',
      name: 'promotion-detail',
      meta: {
        title: '推广明细',
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS, CUSTOMER],
        hidden: true,
        activeMenu: '/promotion',
        parent: {
          title: '推广管理',
          path: '/promotion'
        }
      },
      component: () => import('@/views/promotion/PromotionDetail.vue')
    },
    {
      path: '/promotion/detail/creative',
      name: 'promotion-creative',
      meta: {
        title: '编辑创意',
        auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS, CUSTOMER],
        hidden: true,
        activeMenu: '/promotion',
        parent: [
          {
            title: '推广管理',
            path: '/promotion'
          },
          {
            title: '推广明细',
            path: '/promotion-detail'
          }
        ]
      },
      component: () => import('@/views/promotion/PromotionCreative.vue')
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      meta: {
        title: '数据报表',
        auth: [OPERATION, SALES, ADMIN, CUSTOMER],
        icon: h(DashboardOne, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/dashboard/index.vue')
    },
    {
      path: '/premium',
      name: 'premium',
      meta: {
        title: '套餐配置',
        auth: [AGENT_BOSS],
        icon: h(Buy, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/premium/index.vue')
    },
    {
      path: '/activity-manager',
      name: 'activity-manager',
      meta: {
        title: '活动管理',
        auth: [ADMIN, OPERATION],
        icon: h(Gift, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/activity/ActivityManager.vue')
    },
    {
      path: '/activity-detail',
      name: 'activity-detail',
      meta: {
        title: '活动详情',
        auth: [ADMIN, OPERATION],
        hidden: true,
        activeMenu: '/activity-manager',
        parent: [
          {
            title: '活动管理',
            path: '/activity-manager'
          }
        ]
      },
      component: () => import('@/views/activity/ActivityDetail.vue')
    },
    {
      path: '/banned-word',
      name: 'banned-word',
      meta: {
        title: '禁售词管理',
        auth: [OPERATION, ADMIN],
        icon: h(Forbid, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/word-lib/BannedWord.vue')
    },
    {
      path: '/word-lib',
      name: 'word-lib-word-lib',
      meta: {
        title: '词库管理',
        auth: [OPERATION, ADMIN],
        icon: h(Chinese, {
          theme: 'outline',
          size: '18'
        }),
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/word-lib/WordLibrary.vue')
    },
    /*{
      path: "/monitor",
      name: "monitor",
      meta: {
        title: "热词监控",
        auth: [OPERATION],
        icon: <Analysis theme="outline" size="18" />,
      },
      component: () => import("@/views/monitor/index.vue"),
    },*/
    // {
    //   path: '/diamond-shop',
    //   name: 'diamond-shop',
    //   meta: {
    //     title: '钻石店铺',
    //     auth: [OPERATION, ADMIN, SALES, AGENT, AGENT_BOSS, CUSTOMER],
    //     icon: h(Diamonds, {
    //       theme: 'outline',
    //       size: '18'
    //     }),
    //     parent: {
    //       path: undefined
    //     }
    //   },
    //   component: () => import('@/views/diamond-shop/index.vue')
    // },
    // {
    //   path: '/pz-360',
    //   name: 'pz-360',
    //   meta: {
    //     title: '360采购直达',
    //     icon: h(TreasureChest, {
    //       theme: 'outline',
    //       size: '18'
    //     })
    //   },
    //   component: () => import('@/views/pz-360/Pz360.vue')
    // },
    {
      path: '/:pathMatch(.*)*',
      name: '404',
      meta: {
        title: '404',
        hidden: true,
        parent: {
          path: undefined
        }
      },
      component: () => import('@/views/error/404.vue')
    }
  ]
}
